{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4bbf1453-5f83-4158-b352-12cf076bd27b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a2b46aab-ad07-479c-8bb3-565523e3d427",
   "metadata": {},
   "source": [
    "# 基于线性回归模型的鲍鱼年龄预测"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "09863273-76d4-40f6-96aa-6296162ebcec",
   "metadata": {},
   "source": [
    "数据集介绍"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9be6e99f-af1f-4143-bacd-2e28accc4dad",
   "metadata": {},
   "source": [
    "数据集来源：\n",
    "- Abalone数据集来自于UCI（University of California, Irvine）机器学习存储库，是一个公开的、用于教学和研究的资源。\n",
    "\n",
    "\n",
    "数据集目标：\n",
    "- 数据集的主要目标是基于鲍鱼的物理度量（如长度、直径、高度等）来预测鲍鱼的年龄。\n",
    "\n",
    "\n",
    "特征属性：\n",
    "- 性别（Sex）：包括雄性（M）、雌性（F）和未知（I）\n",
    "- 长度（Length）：最长壳长，单位毫米\n",
    "- 直径（Diameter）：垂直于长度的直径，单位毫米\n",
    "- 高度（Height）：带肉的壳高，单位毫米\n",
    "- 整体重量（Whole weight）：整体鲍鱼重量，单位克\n",
    "- 去壳重量（Shucked weight）：肉质重量，单位克\n",
    "- 内脏重量（Viscera weight）：内脏重量（放血后），单位克\n",
    "- 壳重量（Shell weight）：干燥后的壳重，单位克\n",
    "\n",
    "\n",
    "目标属性：\n",
    "- 数据集的目标属性是鲍鱼的年龄，通常以鲍鱼环（鲍鱼壳上的生长环）数量表示，加上1.5即为实际年龄（以年为单位）。\n",
    "\n",
    "\n",
    "数据量：\n",
    "- 数据集总共包含4177条数据记录。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "72797adb-14f2-4c2d-984a-3f6459b1f82d",
   "metadata": {},
   "source": [
    "## 1、第一次建模"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26383001-d971-4ad3-b8ad-be377744f4c1",
   "metadata": {},
   "source": [
    "### ① 导入数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "fe4102cc-b807-4d45-9c35-6c554323192e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.455</td>\n",
       "      <td>0.365</td>\n",
       "      <td>0.095</td>\n",
       "      <td>0.5140</td>\n",
       "      <td>0.2245</td>\n",
       "      <td>0.1010</td>\n",
       "      <td>0.150</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0.350</td>\n",
       "      <td>0.265</td>\n",
       "      <td>0.090</td>\n",
       "      <td>0.2255</td>\n",
       "      <td>0.0995</td>\n",
       "      <td>0.0485</td>\n",
       "      <td>0.070</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-1</td>\n",
       "      <td>0.530</td>\n",
       "      <td>0.420</td>\n",
       "      <td>0.135</td>\n",
       "      <td>0.6770</td>\n",
       "      <td>0.2565</td>\n",
       "      <td>0.1415</td>\n",
       "      <td>0.210</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0.440</td>\n",
       "      <td>0.365</td>\n",
       "      <td>0.125</td>\n",
       "      <td>0.5160</td>\n",
       "      <td>0.2155</td>\n",
       "      <td>0.1140</td>\n",
       "      <td>0.155</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>0.330</td>\n",
       "      <td>0.255</td>\n",
       "      <td>0.080</td>\n",
       "      <td>0.2050</td>\n",
       "      <td>0.0895</td>\n",
       "      <td>0.0395</td>\n",
       "      <td>0.055</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   0      1      2      3       4       5       6      7   8\n",
       "0  1  0.455  0.365  0.095  0.5140  0.2245  0.1010  0.150  15\n",
       "1  1  0.350  0.265  0.090  0.2255  0.0995  0.0485  0.070   7\n",
       "2 -1  0.530  0.420  0.135  0.6770  0.2565  0.1415  0.210   9\n",
       "3  1  0.440  0.365  0.125  0.5160  0.2155  0.1140  0.155  10\n",
       "4  0  0.330  0.255  0.080  0.2050  0.0895  0.0395  0.055   7"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "abalone = pd.read_table('../dataset/abalone.txt', header=None)\n",
    "abalone.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "b78ee027-221e-4ea2-bcf5-f153dc3c1387",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 4177 entries, 0 to 4176\n",
      "Data columns (total 9 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   0       4177 non-null   int64  \n",
      " 1   1       4177 non-null   float64\n",
      " 2   2       4177 non-null   float64\n",
      " 3   3       4177 non-null   float64\n",
      " 4   4       4177 non-null   float64\n",
      " 5   5       4177 non-null   float64\n",
      " 6   6       4177 non-null   float64\n",
      " 7   7       4177 non-null   float64\n",
      " 8   8       4177 non-null   int64  \n",
      "dtypes: float64(7), int64(2)\n",
      "memory usage: 293.8 KB\n"
     ]
    }
   ],
   "source": [
    "abalone.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e8ae576c-4742-4e4e-870b-856e8090ac65",
   "metadata": {},
   "source": [
    "### ② 划分数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "41f000d8-1fa9-442c-86e5-5445159638ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = abalone.iloc[:, :-1].values\n",
    "target = abalone.iloc[:, -1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "08d9c13e-1c9e-4fb3-9105-11b142f5f0e9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4177,)"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "target.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "715b3eed-4afa-4e22-9dc0-67531ff982ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4177, 8)"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "970b547d-f35e-4060-acd8-190ae89bfae3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "c760e28f-df9a-4d0c-96e9-cb1e0d1dae77",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(data, target, test_size=0.2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9fd60a95-a546-4c37-b9b7-f6f604d6f2a3",
   "metadata": {},
   "source": [
    "### ③ 训练模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "7fce4078-cc77-4040-bd32-227c4ed169cc",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "6b0ba5c0-057a-4888-b7a1-b9bbf8fdc0b4",
   "metadata": {},
   "outputs": [],
   "source": [
    "linear = LinearRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "70e89e0f-abe1-436e-9df3-bc1164283c6e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-6 {color: black;}#sk-container-id-6 pre{padding: 0;}#sk-container-id-6 div.sk-toggleable {background-color: white;}#sk-container-id-6 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-6 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-6 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-6 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-6 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-6 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-6 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-6 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-6 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-6 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-6 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-6 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-6 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-6 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-6 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-6 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-6 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-6 div.sk-item {position: relative;z-index: 1;}#sk-container-id-6 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-6 div.sk-item::before, #sk-container-id-6 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-6 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-6 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-6 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-6 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-6 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-6 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-6 div.sk-label-container {text-align: center;}#sk-container-id-6 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-6 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-6\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LinearRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-6\" type=\"checkbox\" checked><label for=\"sk-estimator-id-6\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LinearRegression</label><div class=\"sk-toggleable__content\"><pre>LinearRegression()</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "LinearRegression()"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linear.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c6a3128a-8692-45ed-9966-9086d7d03540",
   "metadata": {},
   "source": [
    "### ④ 模型预测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "8865f065-ccf1-4696-85d6-473684ba3327",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 7.91206666,  6.16814516,  4.92143781, 13.06314356,  5.0132763 ,\n",
       "       11.09380469, 11.01595329,  6.23653649,  8.44924491,  7.22124877,\n",
       "        8.31509728, 13.04897242,  5.9857057 ,  8.65309831, 11.26422072,\n",
       "        8.81685853, 12.20964179,  9.16308256,  9.91390243, 12.28057295,\n",
       "        8.63497585,  9.60892056, 10.95467849, 10.11348696,  8.31206536,\n",
       "        8.68847195, 10.20652766,  9.93142176, 11.60031515,  4.56431324,\n",
       "        8.84549239, 10.72671861, 13.96448738,  8.23077573, 12.20824742,\n",
       "        8.20267917,  8.85223439, 10.2722503 , 11.80028049, 10.72371386,\n",
       "       12.47960961, 14.69570885, 14.32615628,  8.85336398,  7.64772156,\n",
       "        8.65784778, 13.24895543,  8.48101473, 10.85812995, 13.62677377,\n",
       "       12.83973765,  7.81317051,  9.58089267, 16.58703149, 11.75684144,\n",
       "       11.17988155,  8.30962125,  9.83046937,  9.17157027,  9.69322678,\n",
       "        9.03037343, 13.22513799,  9.79413784,  8.84643998, 10.66476009,\n",
       "       10.4863423 , 11.42142294,  6.63343055, 13.76120905, 13.9079136 ,\n",
       "       12.07139943,  7.48688314,  8.49105683,  9.12799762, 12.52348363,\n",
       "        7.45742493,  7.2452602 ,  9.14418852,  8.25466803, 13.08188642,\n",
       "        7.57222249, 11.50520046,  7.47140745,  9.45468277,  9.03655506,\n",
       "        5.88291032, 12.76944164, 10.2722185 , 12.26084788,  9.76683601,\n",
       "        9.14455209,  7.2116233 ,  9.57742826,  6.54800527,  9.98870141,\n",
       "        9.22498962,  9.06460566,  8.8249588 ,  6.64398501, 13.0363809 ,\n",
       "        9.00494486,  9.83481347,  7.43412804,  8.38916932,  8.2590726 ,\n",
       "       10.5519702 , 11.46562387,  8.24079836,  8.32145026,  8.99961415,\n",
       "       11.4787909 , 10.51412997,  8.54074019,  7.65627062, 10.75432036,\n",
       "        9.89541825,  9.80165241, 11.80218184, 12.38234225, 11.07787856,\n",
       "       10.79906297,  9.1677685 ,  6.89435662, 17.00434727, 10.11374317,\n",
       "       10.93759187,  8.07817314, 10.18693598,  7.25173994,  9.4845822 ,\n",
       "        4.99032634,  6.35486858,  8.33225877,  9.01104337, 15.37844841,\n",
       "       10.44371568,  5.49124669, 10.10176016,  8.34867612,  8.84301263,\n",
       "        9.8167809 ,  7.20891716, 10.81893335, 12.64041426, 10.17842016,\n",
       "       10.50695179, 10.45667845,  9.72081065,  8.97398837,  7.79983265,\n",
       "        8.96365795, 10.43913413,  9.1983043 , 10.46575941,  7.7501918 ,\n",
       "        9.2765084 , 12.79165114,  8.84008633, 12.2107785 , 11.8352821 ,\n",
       "        9.22423814, 13.12153961, 10.61456932, 10.53238882,  7.80812399,\n",
       "        7.93042455,  4.45053576,  8.76337437, 11.91930371,  7.73414672,\n",
       "       10.04999659,  9.28925004,  9.0424616 , 10.50434691,  9.67878192,\n",
       "       10.27208627, 17.22015087,  9.53537259, 10.27257284,  9.59299103,\n",
       "       11.46394982, 12.96689805,  7.77232049, 14.74626983,  9.13443941,\n",
       "        9.32122886, 12.36437364, 10.30377242, 13.01252864,  9.50736307,\n",
       "        8.69496951, 11.0227593 ,  6.94609076, 12.14636044,  7.79597148,\n",
       "        7.48008737,  8.30501772, 10.66836476, 11.17656433, 10.34542293,\n",
       "        7.89520848,  9.31043137,  7.50526737,  9.57176743, 12.74411533,\n",
       "        7.70964991, 10.10399014, 11.42721017,  8.31261296,  8.06811855,\n",
       "        6.50736395,  8.46046985,  8.45588001, 10.46694679, 12.54107542,\n",
       "       12.23964204, 10.2116197 , 10.24138312,  7.13268161, 10.18333059,\n",
       "       10.93083897,  9.19644247,  9.63252544,  8.24918191, 11.93685175,\n",
       "        6.65265288, 10.98995911,  9.63323808,  4.66707439,  9.43898583,\n",
       "       14.26329547, 13.1102699 , 11.01045936, 13.40953125, 10.48630433,\n",
       "       11.21080853, 10.75227839,  7.84813787, 10.17847611,  9.83198239,\n",
       "       11.23872801, 11.77581457, 13.23455881, 14.38866305, 10.74450446,\n",
       "        9.25825336, 12.86393072, 12.93821978,  9.79083708,  7.63844984,\n",
       "        8.44536808,  7.75486318,  9.61445343,  9.41230651,  9.12238628,\n",
       "        7.45408332, 11.8732927 , 13.16844622, 14.5566819 , 11.21993522,\n",
       "       10.43001001, 12.88569187,  8.36053894,  7.19125608,  6.93749602,\n",
       "       10.82043328,  8.77052583, 10.66853652, 11.62775261, 10.05946289,\n",
       "        6.50989988,  5.7796974 , 14.15055749,  8.57146661, 15.15801644,\n",
       "       13.32106317,  9.56579463, 10.7287993 ,  8.8690025 ,  8.77270772,\n",
       "        7.53506779,  9.78122578,  9.90468941, 10.63436047,  9.10790702,\n",
       "       10.92283797, 14.29340587,  6.48975264,  9.87267424, 12.33377724,\n",
       "       11.65360821,  9.60654575, 10.07454557,  9.40731396, 12.31789736,\n",
       "        9.12627361,  7.6017122 ,  9.89255394,  6.8143296 ,  8.54261761,\n",
       "        8.41639743, 14.71308052, 11.60073217, 13.97015384,  9.03336036,\n",
       "        9.37651067,  7.68902703,  9.04802773, 10.38467161,  7.73465441,\n",
       "        8.71663074,  8.46857192, 10.99808956,  8.01831996, 10.22947553,\n",
       "        7.25111488,  8.71852871, 12.59242926,  9.45640137,  7.70143272,\n",
       "       10.09189193,  8.7965805 ,  4.57268267,  9.86377925,  9.28174046,\n",
       "       11.52408856,  8.39791759, 10.59434728, 11.67698809,  9.01946015,\n",
       "       13.47867659, 13.72071641,  6.74005995, 12.01687687,  9.09536588,\n",
       "       10.25059212,  5.98822033, 11.16397755, 11.65098888,  7.10735798,\n",
       "       10.26922056,  7.99410862,  9.86174627,  6.94711259,  6.40085493,\n",
       "       12.99768152,  7.10530926, 12.23281557,  7.83731474,  9.87486754,\n",
       "        9.98772635,  9.29833389, 13.369179  ,  9.62185122,  8.32428301,\n",
       "        7.19199498,  7.51050296, 11.87229671, 11.79066736, 10.44621082,\n",
       "       11.36708692,  5.89373563,  8.51945247, 10.41803826, 12.56699547,\n",
       "        6.08042014, 12.22197994, 10.90379509, 11.79857815, 10.60499005,\n",
       "       13.97207823, 12.61519454, 15.52048982, 12.23667214, 13.19958659,\n",
       "        8.66478704,  8.36126465,  5.44656905, 10.43839423, 10.5329708 ,\n",
       "        9.53455852,  6.13560291,  7.92980034, 10.32972476, 11.90587046,\n",
       "       11.75503598,  8.68474968,  6.38723003,  8.49255082, 12.93264354,\n",
       "       15.24259369,  8.61959669, 11.9933674 , 12.2323171 ,  9.14128442,\n",
       "        7.18955377,  7.98479904, 10.36994601, 10.32972945, 10.97936946,\n",
       "        8.14787847, 13.87928581,  7.64098953, 12.52945939,  7.55724774,\n",
       "        7.11683842, 10.15301773,  9.9107072 ,  7.20391418,  9.24813054,\n",
       "        9.65827083,  9.87403459, 12.33212853,  8.68473758, 10.97809263,\n",
       "       12.31629274, 11.24086908, 11.34940178,  8.82451766,  8.85709433,\n",
       "        9.4997279 , 10.61267151, 13.49937487,  7.90627876, 14.28763387,\n",
       "       13.26287643, 11.21104096, 14.51209923,  9.22953107, 12.29477346,\n",
       "       10.69633699,  6.21603099, 12.78392931,  8.30045629, 12.79761845,\n",
       "        9.67655375,  7.662932  , 10.02612682,  5.35148644, 12.11713   ,\n",
       "       11.52017401, 11.33167164,  6.23274422, 10.08150432, 10.45627395,\n",
       "       11.95319885, 14.36915709, 10.06356444, 10.74607827, 11.58997129,\n",
       "        8.02565016, 11.16401527,  5.97272122,  8.61425378, 13.98440383,\n",
       "        9.65053062, 10.8257251 , 10.56170513, 12.94024095,  8.91931498,\n",
       "        9.17919752,  9.98631325, 12.79421269,  8.28931416, 13.42625861,\n",
       "       16.32328079, 10.92133346,  6.26253363, 12.59433767, 15.62030196,\n",
       "       11.28809352,  9.37769754,  8.51269901, 13.85511505, 10.79965291,\n",
       "        9.80950989, 10.29771664,  4.65115589, 10.13198062,  5.78290775,\n",
       "       13.20086452,  7.29030899,  7.78455073, 13.67710709,  9.89470584,\n",
       "       10.71512593,  9.52658175,  8.57771343, 12.10722243,  9.30580654,\n",
       "        8.08036392, 12.0041215 , 10.0168344 ,  9.28021112,  8.61122886,\n",
       "        8.52781004, 10.72486079, 10.11247931, 10.0767717 ,  8.36636133,\n",
       "        7.43680804,  9.68003494,  8.8711598 ,  9.59503711, 15.59869793,\n",
       "       10.16835676, 13.13519403,  9.70309051, 12.37912106, 11.20154995,\n",
       "        9.4984418 ,  4.90003656, 11.83892537,  7.62881807,  8.42850178,\n",
       "        7.45741556,  8.4373771 ,  5.30226621,  8.53367559,  8.28555533,\n",
       "       11.12168808, 13.77198933, 10.14920201, 10.87495606,  7.51443794,\n",
       "       10.7760404 ,  9.16893923,  8.23852921,  8.383521  , 12.14393288,\n",
       "       10.77571565,  7.58990848, 11.17798113,  7.29128985,  9.816834  ,\n",
       "        9.25345992,  8.99956156, 11.99385458,  9.90243893,  8.7030198 ,\n",
       "        7.03274392,  8.42639399,  5.88571757, 11.70911424,  7.93779879,\n",
       "       10.48578606,  7.144709  , 10.84246765,  9.25152155,  6.44336805,\n",
       "        9.49213479, 13.29553401,  8.79479402,  7.42985921,  7.24178362,\n",
       "       11.72535501, 12.76343407,  7.1430158 , 10.03747048,  8.59009247,\n",
       "       10.87075717,  8.84161147, 13.1992901 , 12.03375659, 13.30451526,\n",
       "       10.75757418,  8.35423707, 10.16592333, 10.65802209,  7.80204857,\n",
       "        9.51272518, 14.59419969,  8.95585769,  7.40892048,  9.3293788 ,\n",
       "        7.94322211,  9.96827865,  6.85212025,  7.77842213,  8.64917548,\n",
       "       10.30611446,  9.6996507 , 10.5537429 ,  9.95698061,  8.54486549,\n",
       "       11.3645909 , 10.93795065,  9.06956268,  8.01032733,  9.60421573,\n",
       "       11.11022646, 10.78597519, 13.48310394, 12.65232155,  9.57591158,\n",
       "        7.17032289, 10.03851403,  6.69273725,  9.59798624, 12.4651044 ,\n",
       "       10.59743716,  6.70975854,  8.55813892,  6.25632508,  8.03543725,\n",
       "        9.72534478,  8.2880609 ,  8.4340336 ,  9.56488919, 14.16087791,\n",
       "        7.54841713, 10.0632972 , 11.3148934 , 10.32882715,  9.88282787,\n",
       "        8.91440934, 13.39967238, 13.4624492 , 10.86744426,  6.32231829,\n",
       "        9.06260383,  8.63206713,  9.29657055, 11.35637291, 11.65439503,\n",
       "       12.18675457, 11.73592084, 11.04515145, 13.18492979, 10.4013995 ,\n",
       "       11.24818159,  7.12036044,  8.89649805,  7.80814427,  8.97194129,\n",
       "       13.47281023,  9.1516134 ,  9.31046282,  7.46929983, 10.87883556,\n",
       "        9.68695361, 11.21127636, 11.27178707, 12.18986388,  8.0993877 ,\n",
       "       10.59866876,  7.88720332, 11.40887648, 10.41939946, 10.38290546,\n",
       "        9.14719742,  8.72747603,  8.56283296,  9.06782608, 10.3564144 ,\n",
       "        9.72346438, 11.16006877, 11.48832402,  9.36388357,  8.62153873,\n",
       "        7.33177272, 12.53053129,  8.11253163,  5.16676738,  8.33471174,\n",
       "        8.49483991,  8.65029868,  8.16629308,  6.53698521, 10.74936074,\n",
       "        7.97296327,  8.59123692,  8.89203586,  6.90046054,  8.02498263,\n",
       "        8.38356645,  9.47979122, 10.29696225,  8.37230469,  9.74356379,\n",
       "        9.93319793,  9.41268858,  9.99211391, 12.71783678, 12.26999136,\n",
       "        8.70598992, 14.40163742,  8.66984268, 15.8129169 , 11.59897078,\n",
       "        5.89148483,  6.4696426 ,  7.49567738, 12.8252528 , 11.29541866,\n",
       "        5.96533358,  8.70682947, 13.07962589,  9.28585656,  8.42916852,\n",
       "        4.53764833,  6.3719316 ,  6.56056053,  9.88073155, 13.95852653,\n",
       "       11.64784094, 11.58513129,  8.63456296,  8.62000486,  8.29251385,\n",
       "        9.90124734, 15.6602328 ,  7.34941418,  5.47101736,  9.79764782,\n",
       "       11.98138699, 10.95775018,  9.68398304, 12.96270327,  9.04637383,\n",
       "        7.68468865, 10.75566334, 14.66618961,  7.32611702,  7.68090789,\n",
       "       10.93755035, 11.04876949,  6.67328459, 10.18149026,  7.99351034,\n",
       "        8.61313379, 11.17678606,  7.64262362,  7.88794494,  9.59065806,\n",
       "        9.99314656, 13.58032737,  9.45892775, 11.02755399,  7.17966249,\n",
       "       13.47558937, 12.33916947,  8.96248093,  9.34823433,  5.46428597,\n",
       "       10.21313024, 18.85498497, 10.53979167, 10.00956238,  9.30078082,\n",
       "        7.13756761,  7.4560602 , 14.51916785,  9.72534098,  9.27208193,\n",
       "        6.62746095,  7.23256582, 11.97856521, 11.37174169,  8.79105364,\n",
       "       11.54206013, 10.10331344, 10.58629171, 11.45457504,  8.06509968,\n",
       "       12.29334067, 11.08246548,  9.39676039,  5.90164911, 10.20922486,\n",
       "        9.00533524,  8.5116845 ,  8.94809477, 11.46744004, 11.41781265,\n",
       "       10.63035836, 10.66714981, 10.32806062,  8.85458276,  8.69232355,\n",
       "        8.56230492,  9.59395228, 12.3307819 , 10.69288636, 10.79385115,\n",
       "        7.31311344, 20.16876662, 10.01805616,  9.30037399,  9.5752694 ,\n",
       "       10.23312002, 12.34513927, 14.93276348,  7.53829149, 11.05265807,\n",
       "        9.77033801,  8.92166671, 11.13406575, 18.10411995, 10.00164697,\n",
       "       10.15996457,  8.81558762,  7.59472425,  7.10398342,  8.65861231,\n",
       "        8.63115426, 10.06174045, 10.67894955,  9.75323798, 12.32509018,\n",
       "        6.91360075,  5.29126465, 11.60480395,  9.24189613, 10.99558561,\n",
       "        8.80245557, 11.57333551,  8.13238143, 11.97362885, 11.88165768,\n",
       "        9.25145584, 10.18076533, 10.38530095, 11.64048001,  8.45674002,\n",
       "        9.45861004, 10.47669497, 10.51640673,  7.13025777,  5.02248354,\n",
       "       12.05146989, 10.95683006, 12.65269006, 12.03700574,  9.929521  ,\n",
       "        7.0983148 ])"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_pred = linear.predict(X_test)\n",
    "y_pred"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "194351d4-3153-4ec6-8f15-078f68360f58",
   "metadata": {},
   "source": [
    "### ⑤ 模型评估"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "0e290e06-4b2e-41ad-8c0d-b85bf3b36e97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5076861943949615"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 决定系数\n",
    "linear.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "1ca5ad22-2ead-42d2-80c4-dbdaae5497df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5324944708108694"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linear.score(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a4a88d9-9f2b-4f33-a125-45a5d7905b54",
   "metadata": {},
   "source": [
    "把数据进行归一化后再训练一次"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f0b8632d-cb58-4467-867d-1586ad36d0c5",
   "metadata": {},
   "source": [
    "## 2、第二次建模"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "430ccd2b-2fb2-4dab-93b2-925430562041",
   "metadata": {},
   "source": [
    "### ① 归一化处理"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d969cd6c-ed3e-4c5a-8498-8bc134463f02",
   "metadata": {},
   "source": [
    "线性函数归一化：$x_{norm} = \\frac{x - x_{min}}{x_{max} - x_{min}}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "bb1e7877-0e27-4fb0-93d7-f913381c3470",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.    ,  0.455 ,  0.365 , ...,  0.2245,  0.101 ,  0.15  ],\n",
       "       [ 1.    ,  0.35  ,  0.265 , ...,  0.0995,  0.0485,  0.07  ],\n",
       "       [-1.    ,  0.53  ,  0.42  , ...,  0.2565,  0.1415,  0.21  ],\n",
       "       ...,\n",
       "       [ 1.    ,  0.6   ,  0.475 , ...,  0.5255,  0.2875,  0.308 ],\n",
       "       [-1.    ,  0.625 ,  0.485 , ...,  0.531 ,  0.261 ,  0.296 ],\n",
       "       [ 1.    ,  0.71  ,  0.555 , ...,  0.9455,  0.3765,  0.495 ]])"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "8fc2fe1a-8276-49a4-8452-db019ec9fc18",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 使用sklearn中的MinMaxScaler\n",
    "from sklearn.preprocessing import MinMaxScaler"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "eb585c58-27e6-45a6-b69b-5501e6dc581c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建一个归一化对象\n",
    "scaler = MinMaxScaler()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "c424c278-c034-488b-a8bf-27460fbeb423",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-7 {color: black;}#sk-container-id-7 pre{padding: 0;}#sk-container-id-7 div.sk-toggleable {background-color: white;}#sk-container-id-7 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-7 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-7 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-7 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-7 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-7 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-7 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-7 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-7 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-7 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-7 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-7 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-7 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-7 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-7 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-7 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-7 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-7 div.sk-item {position: relative;z-index: 1;}#sk-container-id-7 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-7 div.sk-item::before, #sk-container-id-7 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-7 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-7 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-7 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-7 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-7 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-7 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-7 div.sk-label-container {text-align: center;}#sk-container-id-7 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-7 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-7\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>MinMaxScaler()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-7\" type=\"checkbox\" checked><label for=\"sk-estimator-id-7\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">MinMaxScaler</label><div class=\"sk-toggleable__content\"><pre>MinMaxScaler()</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "MinMaxScaler()"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 进行归一化处理\n",
    "scaler.fit(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "e5161d16-995a-43f0-880a-66f593433b45",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 得到归一化处理后的数据\n",
    "data_scaled = scaler.transform(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "b5126de1-d4e5-4764-8682-2b1156322d1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.        , 0.51351351, 0.5210084 , ..., 0.15030262, 0.1323239 ,\n",
       "        0.14798206],\n",
       "       [1.        , 0.37162162, 0.35294118, ..., 0.06624075, 0.06319947,\n",
       "        0.06826109],\n",
       "       [0.        , 0.61486486, 0.61344538, ..., 0.17182246, 0.18564845,\n",
       "        0.2077728 ],\n",
       "       ...,\n",
       "       [1.        , 0.70945946, 0.70588235, ..., 0.3527236 , 0.37788018,\n",
       "        0.30543099],\n",
       "       [0.        , 0.74324324, 0.72268908, ..., 0.35642233, 0.34298881,\n",
       "        0.29347285],\n",
       "       [1.        , 0.85810811, 0.84033613, ..., 0.63517149, 0.49506254,\n",
       "        0.49177877]])"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_scaled"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "feec70ec-37c6-4418-a345-abd2fb8763d2",
   "metadata": {},
   "source": [
    "### ② 分割数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "c3fe877b-60e0-4de9-94ad-865daad7eab5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4177, 8)"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_scaled.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "2df09f9e-218b-4154-8db8-281878fc2e78",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4177,)"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "target.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "52f25a0c-9631-4dfc-9372-aef8bb444b2d",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(data_scaled, target, test_size=0.2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "18ed779e-0d60-45de-aaf6-55766c4b31c1",
   "metadata": {},
   "source": [
    "### ③ 模型训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "d8c79319-9598-49fa-9c18-7fb2e5b2f21c",
   "metadata": {},
   "outputs": [],
   "source": [
    "linear = LinearRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "9a078698-9dc8-4ef3-b7cb-227ca94625a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>#sk-container-id-8 {color: black;}#sk-container-id-8 pre{padding: 0;}#sk-container-id-8 div.sk-toggleable {background-color: white;}#sk-container-id-8 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-8 label.sk-toggleable__label-arrow:before {content: \"▸\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-8 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-8 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-8 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-8 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-8 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-8 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"▾\";}#sk-container-id-8 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-8 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-8 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-8 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-8 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-8 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-8 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-8 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-8 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-8 div.sk-item {position: relative;z-index: 1;}#sk-container-id-8 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-8 div.sk-item::before, #sk-container-id-8 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-8 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-8 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-8 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-8 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-8 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-8 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-8 div.sk-label-container {text-align: center;}#sk-container-id-8 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-8 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-8\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>LinearRegression()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-8\" type=\"checkbox\" checked><label for=\"sk-estimator-id-8\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LinearRegression</label><div class=\"sk-toggleable__content\"><pre>LinearRegression()</pre></div></div></div></div></div>"
      ],
      "text/plain": [
       "LinearRegression()"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linear.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "19beba52-0d8e-4ce2-bc0d-152edfd9651c",
   "metadata": {},
   "source": [
    "### ④ 模型评估"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "89a729e3-5b29-4fdb-866c-0500bed2f9f5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5381853330056081"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linear.score(X_test, y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fd50fb4d-8f94-4d5d-a690-2187206ba4e0",
   "metadata": {},
   "source": [
    "预测效果有提升"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "53f9e8f5-c858-47fe-ad05-33fcb839fea9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.524965724215069"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linear.score(X_train, y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "22f0eac4-f060-407b-86d5-3bcd5be68fc9",
   "metadata": {},
   "outputs": [],
   "source": [
    "w = linear.coef_\n",
    "b = linear.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "5452ed6e-cdcc-44c8-bf6a-bb902780aa7d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x17669b2b250>]"
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAAsTAAALEwEAmpwYAAA370lEQVR4nO2deZgU1fm279NNDwyoDCiioEAwigsI6ERQEpRFcZeoqChKjLK4xmj40MSNaJQ4MRoTfwIuURQRWRx3EUVjxICyCi6oKNsIMgqDCAMMM+f7o7p7enqququ6q7urut/7upSp6qpz3lr6nZpznnpepbVGEARB8B+BXAcgCIIgpIYkcEEQBJ8iCVwQBMGnSAIXBEHwKZLABUEQfEqTbHa233776U6dOmWzS0EQBN+zaNGi77XWbeLXZzWBd+rUiYULF2azS0EQBN+jlFpjtl6GUARBEHyKJHBBEASfIglcEATBp0gCFwRB8CmSwAVBEHyKJHBBEASfIglcEATBp0gCFwRByCQrVsC4cVBT43rTWX2RRxAEoWDYtQu6dYMvvzSWf/Mb6NjR1S7kCVwQBMFt7rkHmjWrT94vvOB68gZ5AhcEQXCPxYvh2GPrly+5BJ5+GpTKSHeSwAVBENJlxw74+c9hw4b6dZWVsN9+Ge1WhlAEQRDS4U9/ghYt6pP3G2+A1hlP3mAjgSulmimlPlRKLVNKfaKUGhde/zOl1AKl1FdKqWlKqaKMRysIguAVPvjAGBq55x5jedQoI3EPGpS1EOwMoewC+mutf1JKhYD3lVKvAzcCD2itn1NKTQCuAB7JYKyCIAi558cfoX17+OknY7moCL77DkpKsh5K0idwbRCOlFD4Pw30B2aE1z8FDM5EgIIgCJ7hd7+Dli3rk/e77xpywRwkb7A5Bq6UCiqllgKbgDnAKqBKa70nvMl6oL3FviOVUguVUgsrKytdCFkQBCHLzJ1rDJc89JCxfOONxnDJiSfmNCxbKhStdS3QQylVArwAHG63A631JGASQGlpqU4hRkEQhNywZQu0bl2/3Lo1rFkDe+2Vu5hicKRC0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FdgZzaDywB2jncE8LDWeguA1npTlmN0GzvHrIF9wj+3BL7NYnwZQWv9HrA5wSbnAJO1wXygRCl1YKr9eS2B27GojW6jtd4DbAX2zUp0mcGWLW8MV2D8BvczSY85/KflwVrrV7MZWIawc40PAw5TSs1TSs1XSp2ategyg51jvhMYppRaD7wGXJed0HKK0+97QlKuyCNkH6XUMKAUODHXsWQSpVQA+DvwmxyHkk2aYAyjnITxF9Z7SqluWuuqXAaVYYYCT2qt71dKHQ88rZTqqrWuy3VgfsFrT+B2LGqj2yilmmD86fVDVqLLDLZseZVSA4E/AWdrrXdlKbZMkeyY9wa6Au8qpVZjjBW+5OOJTDvXeD3wkta6Rmv9DfAFRkL3K3aO+QrgeQCt9f+AZhiGT/mMqzbcXkvgdixqXwKGh38+H5irw7MDPiXpMSulegITMZK338dGIckxa623aq3301p30lp3whj3P1trvTA34aaNnfu6HOPpG6XUfhhDKl9nMUa3sXPMa4EBAEqpIzASeL6X7XoJuCysRukNbNVab0i5tVzP2lrM0n6BMYP9p/C6P2N8gcG4yNOBr4APgc65jjkLx/wW8B2wNPzfS7mOOdPHHLftu/hYhWLzGiuMYaNPgeXARbmOOQvHfCQwD0OhshQ4Jdcxu3DMU4ENQA3GX1VXAKOB0THX+eHwOVme7n0tr9ILgiD4FK8NoQiCIAg2kQQuCILgUySBC4Ig+BRJ4IIgCD5FErggCIJPkQQuCILgUySBC4Ig+JT/D0cb7G/nnt32AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 画一下第五个特征\n",
    "x = data_scaled[:, 4]\n",
    "y = target.values\n",
    "\n",
    "plt.scatter(x=x, y=y)\n",
    "plt.plot(x, w[4]*x+b, c='r')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2769a397-c5d5-4c86-8926-2163112fccc0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
